package it.avantsoft.ls.gl.command;

import it.avantsoft.ls.gl.GroupChildHandler;

public class WelcomeCommand extends GroupChildCommand {
    private int childListeningPort;

    public WelcomeCommand(GroupChildHandler child, int childListeningPort) {
        super(child);

        this.childListeningPort = childListeningPort;
    }

    public void execute() {
        GroupChildHandler child = getChild();
        child.setListeningPort(childListeningPort);

        child.welcome();
    }

    public String toString() {
        return "WelcomeCommand{" +
                "child=" + getChild() +
                ", childListeningPort=" + childListeningPort +
                '}';
    }
}
